package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	gpb "gitee.com/cloudapex/protos/crm_order/pb"
	"google.golang.org/grpc"
)

var StudentOrder studentOrder

type studentOrder struct {
	cli gpb.StudentOrderClient
}

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_CRM_ORDER, func(c *grpc.ClientConn) {
		StudentOrder.cli = gpb.NewStudentOrderClient(c)
	})
}

func (this *studentOrder) StudentOrderGet(ctx context.Context, in *gpb.StudentOrderGetReq) (*gpb.StudentCreateRes, error) {
	return this.cli.StudentOrderGet(ctx, in)
}

func (this *studentOrder) StudentOrderCreate(ctx context.Context, in *gpb.StudentCreateReq) (*gpb.StudentCreateRes, error) {
	return this.cli.StudentOrderCreate(ctx, in)
}

func (this *studentOrder) StudentOrderCreateList(ctx context.Context, in *gpb.StudentCreateListReq) (*gpb.StudentCreateRes, error) {
	return this.cli.StudentOrderCreateList(ctx, in)
}

func (this *studentOrder) StudentOrderStatus(ctx context.Context, in *gpb.StudentOrderStatusReq) (*gpb.StudentCreateRes, error) {
	return this.cli.ChangeStudentOrder(ctx, in)
}

func (this *studentOrder) StudentList(ctx context.Context, in *gpb.StudentListReq) (*gpb.StudentListRes, error) {
	return this.cli.StudentList(ctx, in)
}
